import { list2Obj } from '@/pages/supplier/utils';

const MENU_ID = 350

const PLAN_STATUS = [
  { label: '待提交', value: 1 },
  { label: '待审核', value: 10 },
  { label: '审核通过', value: 20 },
  { label: '审核驳回', value: 30 },
  { label: '撤回', value: 40 },
]

// 供应商管理 - 供应商资质管理
const FORM_ITEM_LIST = [
  {
    prop: 'planCode',
    label: '计划编号',
    type: 'input',
  },
  {
    prop: 'planName',
    label: '计划名称',
    type: 'input',
  },
  {
    prop: 'planYear',
    label: '核查年限',
    type: 'yearRange',
    props: ['startYear', 'endYear']
  },
  {
    prop: 'status',
    label: '计划状态',
    type: 'select',
    clearable: true,
    options: PLAN_STATUS
  },
  {
    prop: 'createUser',
    label: '计划拟定人',
    type: 'input',
  },
  {
    prop: 'doTime',
    label: '拟定时间',
    type: 'datePicker',
    datePickerType: 'daterange',
    valueFormat: 'yyyy-MM-dd'
  },
]
const TABLE_COLUMNS = [
  {
    title: '计划编号',
    key: 'planCode'
  },
  {
    title: '计划名称',
    key: 'planName',
  },
  {
    title: '计划核查年限',
    key: 'planYear',
  },
  {
    title: '计划状态',
    key: 'status',
    formatter: (row, columns, cellValue) => {
      return list2Obj(PLAN_STATUS)[cellValue]
    }
  },
  {
    title: '创建人',
    key: 'createUser',
  },
  {
    title: '创建时间',
    key: 'createTime',
  },
]
export {
  FORM_ITEM_LIST,
  TABLE_COLUMNS,
  MENU_ID
}
